<template>
  <el-input
    v-bind="attrs" 
    v-model="value"
    @input="handleInput"
  />
</template>

<script setup>
import {computed,defineEmits,useAttrs } from 'vue'

// 透传属性
const attrs = useAttrs()

const props = defineProps({
  modelValue: { type: String },
});

const emit = defineEmits(['update:modelValue'])
const value = computed({
  get() {
    return props.modelValue
  },
  set(value) {
    emit('update:modelValue', value)
  }
})

const handleInput = (value) => {
  console.log("组件内部input事件逻辑")
  if(attrs?.events?.input){
    attrs.events.input(value)
  }
}

</script>